<?php
defined('_JEXEC') or die('Restricted access');
require_once(JPATH_COMPONENT.DS.'persistance'.DS.'DAOFactory.php');
require_once(JPATH_COMPONENT.DS.'domain'.DS.'DTOWord.php');
require_once(JPATH_COMPONENT.DS.'domain'.DS.'DTOLang.php');
require_once(JPATH_COMPONENT.DS.'domain'.DS.'DTOLangQa.php');
require_once(JPATH_COMPONENT.DS.'domain'.DS.'DTOInfo.php');
require_once(JPATH_COMPONENT.DS.'domain'.DS.'DTONumber.php');
require_once(JPATH_COMPONENT.DS.'domain'.DS.'DTOSong.php');
require_once(JPATH_COMPONENT.DS.'domain'.DS.'DTOQa.php');
require_once('DAOLangImpl.php');
require_once('DAOWordImpl.php');
require_once('DAOInfoImpl.php');
require_once('DAONumberImpl.php');
require_once('DAOSongImpl.php');
require_once('DAOQaImpl.php');
require_once('DAOLangQaImpl.php');

class DAOFactoryImpl extends DAOFactory{
	
	private static $instance;
	
	public static function getInstance() 
	    {
	        if (!isset(self::$instance)) {
	            $c = __CLASS__;
	            self::$instance = new $c;
	        }
	        return self::$instance;
	}
	
	private function __construct(){
		
	}
	
	public function getConnection(){
		
		$db =& JFactory::getDBO();
		
		return $db;
	}

	
	public function close($connection){
				
		return true;
	}

	public function getDAOLang(){
		return new DAOLangImpl();
	}
	
	public function getDAONumber(){
		return new DAONumberImpl();
	}
	
	public function getDAOWord(){
		return new DAOWordImpl();
	}
	
	public function getDAOInfo(){
		return new DAOInfoImpl();
	}
	
	public function getDAOSong(){
		return new DAOSongImpl();
	}
	
	public function getDAOLangQa(){
		return new DAOLangQaImpl();
	}
	
	public function getDAOQa(){
		return new DAOQaImpl();
	}
	
	public function createDTOWord(){
		return new DTOWord();
	}
	
	public function createDTOLang(){
		return new DTOLang();	
	}
	
	public function createDTOInfo(){
		return new DTOInfo();
	}
	
	public function createDTONumber(){
		return new DTONumber();
	}
	
	public function createDTOSong(){
		return new DTOSong();
	}
	
	public function createDTOQa(){
		return new DTOQa();
	}
	
	public function createDTOLangQa(){
		return new DTOLangQa();
	}
	
}